package com.hl.card.modular.pack.service;

import com.hl.card.common.persistence.model.LogjnDay;
import org.springframework.data.redis.core.StringRedisTemplate;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.concurrent.TimeUnit;


public class LoginDayService {
	   @Resource(name="stringRedisTemplate")
	    private StringRedisTemplate stringRedisTemplate;
	   
	   //获取每日签到 
	public static String getLoginDayInfo(String userId, Integer loginNumber, StringRedisTemplate stringRedisTemplate) throws IOException  {
		LogjnDay logjnDay= getLogjnDayloginNumber(userId, loginNumber, stringRedisTemplate);
		if(logjnDay==null ) {
			System.out.println("用户为空签到失败"+logjnDay);
		}else {
			
		}
		
		
		return null;
	
		
	}
	
	 //获取每日签到 
    public static LogjnDay getLogjnDayloginNumber(String userId,Integer loginNumber, StringRedisTemplate stringRedisTemplate) {
        String refreshLoginNumbe = stringRedisTemplate.opsForValue().get("userId");
             
        stringRedisTemplate.opsForValue().set("userId", refreshLoginNumbe, 2, TimeUnit.HOURS);//向redis里存入数据和设置缓存时间
        return null;

 }

}